-- Decompiled with the Synapse X Luau decompiler.

local l__CommonOHOH__1 = _G.CommonOHOH;
local l__ServerOHOH__2 = _G.ServerOHOH;
local l__ScriptContext__3 = game:GetService("ScriptContext");
local v4 = l__CommonOHOH__1.class.new(script, l__CommonOHOH__1.files.BaseComponent());
function v4.CreationPlayer(p1, p2, p3)
	return {
		game_id = tostring(p1.gameKey), 
		gaid = "", 
		uuid = tostring(p1.playerId), 
		name = tostring(p1.playerName), 
		language = 0, 
		country = "", 
		ip = "", 
		created_at = os.time(), 
		app_version = p1.bulid, 
		at_type = 0, 
		ab_value = 0, 
		device_id = "", 
		channel = "", 
		platform = "", 
		device_language = "", 
		extend_1 = p2 and "", 
		extend_2 = p3 and ""
	};
end;
function v4.PlayGameTime(p4, p5, p6)
	return {
		game_id = tostring(p4.gameKey), 
		device_id = "", 
		role_name = tostring(p4.playerName), 
		role_id = tostring(p4.playerId), 
		secs = os.time() - p4.playerTime, 
		event_time = os.time(), 
		game_version = p4.bulid, 
		app_version = p4.bulid, 
		extend_1 = p5 and "", 
		extend_2 = p6 and ""
	};
end;
function v4.PlayerLogin(p7, p8, p9, p10)
	return {
		name = tostring(p7.playerName), 
		uid = tostring(p7.playerId), 
		device_id = "", 
		language = 0, 
		country = "", 
		game_id = tostring(p7.gameKey), 
		ip = "", 
		extend = tostring(p8) and " ", 
		app_version = p7.bulid, 
		created_at = os.time(), 
		device_language = "", 
		extend_1 = p9 and "", 
		extend_2 = p10 and ""
	};
end;
function v4.PlayerAction(p11, p12, p13, p14, p15)
	return {
		player_id = tostring(p11.playerId), 
		action_id = tonumber(p12), 
		extend = tostring(p13) and "", 
		game_id = tostring(p11.gameKey), 
		created_at = os.time(), 
		uuid = "", 
		extend_1 = p14 and "", 
		extend_2 = p15 and ""
	};
end;
function v4.Funnel(p16, p17, p18, p19)
	return {
		game_id = tostring(p16.gameKey), 
		uid = tostring(p16.playerId), 
		game_step_id = tonumber(p17), 
		created_at = os.time(), 
		extend_1 = p18 and "", 
		extend_2 = p19 and ""
	};
end;
function v4.PlayerResources(p20, p21, p22, p23, p24, p25, p26)
	return {
		player_id = tostring(p20.playerId), 
		id = tonumber(p21), 
		change_amount = tonumber(p24), 
		new_amount = tonumber(p24), 
		reason = tonumber(p23), 
		extend = p22 and "", 
		game_id = tostring(p20.gameKey), 
		created_at = os.time(), 
		uuid = tostring(p20.playerId), 
		extend_1 = p25 and "", 
		extend_2 = p26 and ""
	};
end;
function v4.new(p27)
	if p27 and p27.main_inst then
		return v4(p27);
	end;
	warn("player main_inst  is  nil");
	return false;
end;
function v4.ctor(p28, p29)
	v4.super.ctor(p28, p29);
	p28:Init();
end;
local u1 = l__ServerOHOH__2.load.GameDataConfig();
function v4.Init(p30)
	p30.account_age = p30.parent.main_inst.AccountAge;
	p30.vip = p30:TestVIP();
	p30.group = p30:TestGroup();
	p30.playerTime = os.time();
	p30.language = p30.parent.main_inst.LocaleId;
	p30.playerId = p30.parent.main_inst.UserId;
	p30.playerName = p30.parent.main_inst.Name;
	p30.gameKey = u1.GameKey;
	p30.bulid = u1.Building;
	p30.ip = u1.Ip;
	p30.player_msg = {
		AccountAge = p30.account_age, 
		Premium = p30.vip, 
		Language = p30.language, 
		Group = p30.group
	};
end;
function v4.PlayerLoginGame(p31)
	local v5 = p31.parent:GetComponent(l__ServerOHOH__2.load.Server_PlayerDataComponent());
	local v6 = v5:GetData("prop");
	local l__list__7 = v5:GetData("stage").__real.list;
	if not v6.__real.first then
		v5:Execut(function()
			v6.first = true;
		end);
		p31:FireCreatePlayer();
	end;
	p31:FirePlayerAction(15, nil, {
		stage = l__list__7[#l__list__7], 
		gold = v6.__real.gold, 
		diamond = v6.__real.diamond, 
		reborn = v6.__real.reborn, 
		svip = v6.__real.svip, 
		vip = v6.__real.vip
	});
end;
function v4.PlayerOutGame(p32)
	local v8 = p32.parent:GetComponent(l__ServerOHOH__2.load.Server_PlayerDataComponent());
	local v9 = v8:GetData("prop");
	local l__list__10 = v8:GetData("stage").list;
	p32:FirePlayerAction(16, nil, {
		stage = l__list__10[#l__list__10], 
		gold = v9.gold, 
		diamond = v9.diamond, 
		reborn = v9.reborn, 
		svip = v9.svip, 
		vip = v9.vip
	});
	p32:FirePlayerTime();
end;
function v4.TestGroup(p33)
	if p33.parent.main_inst:IsInGroup(u1.GroupId) then
		return true;
	end;
	return false;
end;
function v4.TestVIP(p34)
	if p34.parent.main_inst.MembershipType == Enum.MembershipType.Premium then
		return true;
	end;
	return false;
end;
local l__HttpService__2 = game:GetService("HttpService");
function v4.HTTPExceptionHand(p35, p36, p37, p38, p39)
	if not p36 or not p37.Success then
		local u3 = 0;
		local u4 = p36;
		local u5 = nil;
		local u6 = nil;
		p35:AddProcess(function()
			p35:AddCo();
			while true do
				if u3 > 10 then
					return false;
				end;
				if u4 and u5.Success then
					break;
				end;
				local v11, v12 = pcall(function()
					u5 = l__HttpService__2:RequestAsync({
						Url = p38, 
						Method = "POST", 
						Body = p39
					});
				end);
				u4 = v11;
				u6 = v12;
				u3 = u3 + 1;
				p35:Wait(3);			
			end;
			return true;
		end);
	end;
	return true;
end;
local l__RunService__7 = game:GetService("RunService");
function v4.StudioSwichHTTP(p40)
	if l__RunService__7:IsStudio() then
		return u1.Studio;
	end;
	if not p40.playerId and tostring(p40.playerId) <= 0 then
		return false;
	end;
	return true;
end;
function v4.HttpPost(p41, p42, p43)
	local u8 = nil;
	local v13, v14 = pcall(function()
		u8 = l__HttpService__2:RequestAsync({
			Url = p41.ip .. p43, 
			Method = "POST", 
			Body = p42
		});
	end);
	return v13;
end;
local u9 = l__CommonOHOH__1.load.GameDataManager();
function v4.FirePlayerTime(p44, p45, p46)
	local v15 = nil;
	if p45 then
		v15 = tostring(l__HttpService__2:JSONEncode(p45));
	end;
	u9:AddQueue({ l__HttpService__2:JSONEncode(p44:PlayGameTime(v15, p46)), p44.ip .. u1.PlayerTime });
end;
function v4.FirePlayerAction(p47, p48, p49, p50, p51)
	local v16 = nil;
	if p50 then
		v16 = tostring(l__HttpService__2:JSONEncode(p50));
	end;
	u9:AddQueue({ l__HttpService__2:JSONEncode(p47:PlayerAction(p48, p49, v16, p51)), p47.ip .. u1.PlayerAction });
end;
function v4.FireCreatePlayer(p52, p53)
	local v17 = nil;
	if p53 then
		v17 = tostring(l__HttpService__2:JSONEncode(p53));
	end;
	u9:AddQueue({ l__HttpService__2:JSONEncode(p52:CreationPlayer(v17, (l__HttpService__2:JSONEncode(p52.player_msg)))), p52.ip .. u1.PlayerCreat });
end;
function v4.FirePlayerLogin(p54, p55, p56, p57)
	local v18 = nil;
	if p56 then
		v18 = tostring(l__HttpService__2:JSONEncode(p56));
	end;
	u9:AddQueue({ l__HttpService__2:JSONEncode(p54:PlayerLogin(p55, v18, p57)), p54.ip .. u1.PlayerLogin });
end;
function v4.FirePlayerResources(p58, p59, p60, p61, p62, p63, p64)
	local v19 = nil;
	if p63 then
		v19 = tostring(l__HttpService__2:JSONEncode(p63));
	end;
	u9:AddQueue({ l__HttpService__2:JSONEncode(p58:PlayerResources(p59, p60, p61, p62, v19, p64)), p58.ip .. u1.PlayerRes });
end;
function v4.GameFunnel(p65, p66, p67, p68)
	local v20 = nil;
	if p67 then
		v20 = tostring(l__HttpService__2:JSONEncode(p67));
	end;
	u9:AddQueue({ l__HttpService__2:JSONEncode(p65:Funnel(p66, v20, p68)), p65.ip .. u1.PlayerGameStart });
end;
function v4.dtor(p69)
	v4.super.dtor(p69);
end;
return v4;
